﻿//DdeColumnsComboBoxEditor.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Quik.Xaml
{
	using System.Collections.Generic;

	using Xceed.Wpf.Toolkit.PropertyGrid.Editors;

	/// <summary>
	/// Визуальный редактор для выбора набора столбцов DDE таблицы.
	/// </summary>
	public class DdeSecurityColumnsComboBoxEditor : TypeEditor<DdeSecurityColumnsComboBox>
	{
		/// <summary>
		/// Получить список столбцов по их названиям.
		/// </summary>
		/// <param name="columns">Названия столбцов.</param>
		/// <returns>Список столбцов.</returns>
		public static IEnumerable<DdeTableColumn> GetColumns(IEnumerable<string> columns)
		{
			return typeof(DdeSecurityColumns).GetColumns(columns);
		}

		/// <summary>
		/// 
		/// </summary>
		protected override void SetValueDependencyProperty()
		{
			ValueProperty = DdeColumnsComboBox.SelectedColumnsProperty;
		}
	}
}
